/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.File;
import java.io.IOException;

/**
 * <p>Project: javaseapp - File1
 * <p>Powered by webrx On 2021-08-11 11:57:09
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class File1 {
    public static void main(String[] args) throws IOException {
        File f = new File("user");
        System.out.println(f.isAbsolute());
        System.out.println(f.isDirectory());
        System.out.println(f.isHidden());
        System.out.println(f.isFile());
        System.out.println(f.exists());

        //建立文件,空文件
        File uf1 = new File("user1.txt");
        File uf2 = new File(".", "user2.txt");
        System.out.println(uf1.createNewFile());
        System.out.println(uf2.createNewFile());

        //删除文件
        //if (uf1.exists()) uf1.delete();
        //if (uf2.exists()) uf2.deleteOnExit();
    }
}
